<template>
	<div class="_wrapper _p20">
		<div class="_flex _flex-dis-200p _flex-start _flex-space-x">
			<div>
				<el-input v-model="cameraIndexCode" placeholder="请输入视频编码"></el-input>
			</div>
			<div>
				<div v-for="item in $store.state.ai.videoTypeList">
					<el-radio :label="item.val" border>{{item.name}}</el-radio>
				</div>
			</div>
			<el-button @click="play()">开始分析</el-button>
		</div>
		<iframe class="_box-800p _m-t-10 _border _wrapper-x" :src="aiUrl"></iframe>
	</div>
</template>

<script>
	import ToolAction from "@/tool/http/tool-action"
	
	export default {
		data() {
			return {
				cameraIndexCode: "",
				aiUrl: undefined
			}
		},
		methods: {
			play() {
				ToolAction.run("action-video-get-url", "40289f5a7e3c994d017e3c998daf0000", {
					cameraIndexCode: this.cameraIndexCode,
					streamUrlProtocol: "PROTOCOL_RTSP"
				}).then(res => {
					// this.aiUrl = undefined;
					this.$nextTick(() => {
						this.aiUrl = "http://192.168.1.28:8082/vision?model=Person&source=" + res.data.url;
					})
				})
			}
		},
	}
</script>

<style>
</style>
